<?php
namespace app\index\controller;

use  think\Db;
use  think\Url;
use  think\Controller;
class Index extends Controller
{

    private $db;

    public function  __construct() {
        parent::__construct();
        $this->db = Db::name('banner');
    }

    public function index()
    {
        //查询轮播
        $benner = $this->db->where(['flg'=>1])->select();
        //查询入口
        $loginImg = $this->db->where(['flg'=>2])->limit('3')->order(['datetime' => 'desc'])->select();

        $this->assign('benner',$benner);
        $this->assign('loginImg',$loginImg);
        return $this->fetch();
    }
}
